const state = {
  user: {
    username: "moduleA",
    password: "123456",
  },
};
// mutations用作处理同步方法
const mutations = {
  updatePassword: (state, newPassword) => {
    // 修改password
    state.user.password = newPassword;
  },
};
// actions用作处理异步方法，可以调用mutations
const actions = {
  updatePass({ commit }) {
    commit("updatePassword");
  },
};

export default {
  namespaced: true,
  state,
  mutations,
  actions,
};
